package com.education.basic.action;

import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.education.basic.resource.Courses;
import com.yunshangwoniu.core.baseAction.BaseAction;

@Controller
@Scope("prototype")
@Namespace("/course")
@ParentPackage(value="struts-default")
public class CourseAction extends BaseAction
{
	private static final long serialVersionUID = 1625112838391429166L;
	
	List<Courses> courses;									//课程集合
	private String CoursesTypeCode;							//选修或者是必修的编码
	
	@Action(value="list",results={@Result(name="success",location="list.jsp")})
	public String list()
	{
		courses =  Courses.queryCourseByMajorCodeAndCoursesType(null, CoursesTypeCode);
		return SUCCESS;
	}

	public List<Courses> getCourses()
	{
		return courses;
	}

	public void setCourses(List<Courses> courses)
	{
		this.courses = courses;
	}

	public String getCoursesTypeCode()
	{
		return CoursesTypeCode;
	}

	public void setCoursesTypeCode(String coursesTypeCode)
	{
		CoursesTypeCode = coursesTypeCode;
	}

	public static long getSerialversionuid()
	{
		return serialVersionUID;
	}
	
}
